from PySide2.QtWidgets import QApplication, QLineEdit, QPushButton,  QPlainTextEdit
from PySide2.QtUiTools import QUiLoader
from threading import Thread
from PySide2.QtCore import Signal, QObject

import time

app = QApplication([])

ui = QUiLoader().load("main.ui")
ui.show()

def signalFunc(plainTextEdit, msg):
    plainTextEdit.appendPlainText(msg)

class MySignals(QObject):
    signal = Signal(QPlainTextEdit, str)

ms = MySignals()
ms.signal.connect(signalFunc)

def threadFunc():
    for i in range(5):
        ms.signal.emit(ui.plainTextEdit, "No." + str(i))
        time.sleep(1)

thread = Thread(target=threadFunc)
thread.start()

app.exec_()